<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>提币</title>
    <link rel="stylesheet" href="../../css/reset.css" />
    <style>
        body {
            width: 100%;
            background-color: #fff;
            font-size: 0.28rem;
            height: auto;
            -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
            font-family: Helvetica;
            color: #333333;
            padding-bottom: 0.5rem;
        }

        input {
            border: none;
            outline: none;
            background-color: #fff;
            font-size: 0.26rem;
        }

        input::placeholder {
            color: #d9d9d9;
        }

        .typeCoinImg {
            width: 6.9rem;
            height: 1.52rem;
            padding: 0 0.4rem;
            margin: auto;
            border-radius: 0.2rem;
            background: -webkit-linear-gradient(left, #ffe15b, #fccd41);
            box-sizing: border-box;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            -webkit-justify-content: space-between;
            align-items: center;
            -webkit-align-items: center;
            margin-top: 0.2rem;
        }

        .coinName {
            font-size: 0.35rem;
            color: rgba(24, 24, 24, 0.65);
            font-weight: 600;
        }

        #coinNum {
            flex: 1;
            font-weight: 500;
            color: #181818;
            margin-left: 0.15rem;
            padding-top: 0.05rem;
        }

        .showmoney {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            -webkit-align-items: flex-end;
        }

        .changeR {
            font-size: 0.3rem;
            font-weight: 380;
            margin-top: 0.15rem;
            color: rgba(24, 24, 24, 0.65);
        }

        .about-me {
            margin-top: 0.2rem;
            height: 1.86rem;
            background-color: white;
            display: -webkit-flex;
            padding: 0 0.26rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            -webkit-flex-direction: column;
            justify-content: center;
            -webkit-justify-content: center;
            border-bottom: 1px solid #e5e5e5;
        }

        .about-me p:first-of-type {
            height: 0.5rem;
            color: #666666;
            line-height: 0.5rem;
        }

        .about-me p:last-of-type {
            height: 1.08rem;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            -webkit-justify-content: space-between;
            align-items: center;
            -webkit-align-items: center;
        }

        .coin-type {
            background-color: #fff;
            padding: 0 0.26rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            -webkit-flex-direction: column;
            color: #666666;
        }

        .coin-type ul li {
            display: flex;
            display: -webkit-flex;
            align-items: center;
            -webkit-align-items: center;
            height: 1rem;
            border-bottom: 1px solid #e5e5e5;
        }

        .coin-type ul li:first-of-type input {
            flex: 1;
            height: 0.8rem;
            outline: none;
            border: none;
            font-size: 0.28rem;
        }

        .coin-type ul li:first-of-type input::-webkit-input-placeholder {
            color: #d9d9d9;
        }

        .coin-type ul li:nth-of-type(2) {
            height: 2.2rem;
            flex-direction: column;
            -webkit-flex-direction: column;
            justify-content: space-between;
            -webkit-justify-content: space-between;
            align-items: flex-start;
            -webkit-align-items: flex-start;
        }

        .coin-type ul li:last-of-type {
            height: 0.5rem;
            font-size: 0.28rem;
            color: #ffd203;
            border: none;
            margin-bottom: 0.7rem;
            border-bottom: none;
        }

        .outnum {
            width: 100%;
            height: auto;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            -webkit-justify-content: space-between;
            align-items: center;
            -webkit-align-items: center;
        }

        .outnum input {
            flex: 1;
            height: 1rem;
            font-size: 0.28rem;
        }

        .rangeBackground {
            display: inline-block;
            position: relative;
            vertical-align: middle;
            width: 100%;
        }

        .rangeBackground>span {
            background: #e8e7e7;
            width: 100%;
            height: 5px;
            border-radius: 4px;
            top: 50%;
            display: block;
            width: 100%;
        }

        .rangeInput {
            width: 100%;
            -webkit-appearance: none;
            display: inline-block;
            border-radius: 10px;
            background: none;
            border: none;
            height: 5px;
            float: none;
            vertical-align: middle;
            background: -webkit-linear-gradient(#fabf38, #fabf38) no-repeat;
            background: -moz-linear-gradient(#fabf38, #fabf38) no-repeat;
            background: linear-gradient(#fabf38, #fabf38) no-repeat;
            background-size: 0% 100%;
            position: absolute;
            z-index: 1;
            margin-top: 0px;
        }

        .rangeInput::-moz-range-progress {
            background: linear-gradient(#fabf38, #fabf38) no-repeat;
            height: 5px;
        }

        .showBhpayAcc {
            width: 100%;
            height: 1.25rem;
            background: url(../../image/newimgoutcoin.png) no-repeat;
            background-size: 100% 100%;
            opacity: 1;
            border-radius: 0.05rem;
            margin: 0.3rem 0;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            color: #ffffff;
            box-sizing: border-box;
            padding-left: 0.3rem;
            font-size: 0.28rem;
            color: rgba(75, 62, 49, 1);
            position: relative;
        }

        .showBhpayAcc p:first-of-type {
            margin-bottom: 0.1rem;
            font-size: 0.26rem;
            color: rgba(75, 62, 49, 1);
        }

        .showBhpayAcc>a {
            position: absolute;
            right: 0.4rem;
            bottom: 0.26rem;
            font-size: 0.24rem;
            font-family: PingFang SC;
            font-weight: 500;
            color: rgba(75, 62, 49, 1);
            opacity: 0.68;
        }

        .showNoBhpay {
            width: 100%;
            height: auto;
            color: #898989;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            font-size: 0.24rem;
            box-sizing: border-box;
        }

        #openBhpayAcc {
            width: 6.9rem;
            height: 0.88rem;
            text-align: center;
            font-size: 0.26rem;
            line-height: 0.88rem;
            border: none;
            outline: none;
            background-color: #ffd203;
            border-radius: 0.1rem;
            margin-top: 0.2rem;
            color: #212121;
        }

        .rangeInput::-webkit-slider-thumb {
            -webkit-appearance: none;
        }

        .rangeInput::-webkit-slider-runnable-track {
            height: 0;
            background: none;
            border: 0;
        }

        .rangeInput:focus {
            outline: none;
        }

        .rangeInput::-webkit-slider-thumb {
            /*圆形滑块*/
            -webkit-appearance: none;
            height: 30px;
            width: 30px;
            border: 1px solid #eee;
            margin-top: -16px;
            /*使滑块超出轨道部分的偏移量相等*/
            background: #ffffff;
            border-radius: 50%;
            /*外观设置为圆形*/
            /* border: solid 0.125em #ffd203; 设置边框 */
            box-shadow: 0 0 3px #c9c9c9;
            /*添加底部阴影*/
        }

        .rangeInput {
            -webkit-appearance: none;
            width: 100%;
            border-radius: 4px;
            margin-left: -1px;
        }

        .rangeInput::-ms-track {
            height: 25px;
            border-radius: 10px;
            box-shadow: 0 1px 1px #def3f8, inset 0 0.125em 0.125em #0d1112;
            border-color: transparent;
            /*去除原有边框*/
            color: transparent;
            /*去除轨道内的竖线*/
        }

        .rangeInput::-ms-thumb {
            height: 19px;
            width: 19px;
            margin-top: -10px;
            /*使滑块超出轨道部分的偏移量相等*/
            background: #ffffff;
            border-radius: 50%;
            /*外观设置为圆形*/
            border: solid 0.125em #fabf38;
            /*设置边框*/
            box-shadow: 0 0em 0em #ffd203;
            /*添加底部阴影*/
        }

        .rangeInput::-ms-fill-lower {
            /*进度条已填充的部分*/
            height: 5px;
            border-radius: 4px;
            background: linear-gradient(#fabf38, #fabf38) no-repeat;
        }

        .rangeInput::-ms-fill-upper {
            /*进度条未填充的部分*/
            height: 5px;
            border-radius: 4px;
            background: #e8e7e7;
        }

        .rangeInput:focus::-ms-fill-lower {
            background: linear-gradient(#fabf38, #fabf38) no-repeat;
        }

        .rangeInput:focus::-ms-fill-upper {
            background: #e8e7e7;
        }

        .seft-num {
            color: #666666;
            background-color: white;
            width: 100%;
            height: 1rem;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            -webkit-justify-content: space-between;
            align-items: center;
            -webkit-align-items: center;
        }

        .seft-num input {
            flex: 1;
            display: inline-block;
            outline: none;
            border: none;
            height: 0.66rem;
            font-size: 0.28rem;
        }

        .seft-num input::-webkit-input-placeholder {
            color: #d9d9d9;
        }

        .seft-num button {
            outline: none;
            border: none;
            width: 2.2rem;
            height: 0.7rem;
            text-align: center;
            line-height: 0.7rem;
            color: #181818;
            border-radius: 0.1rem;
            background: #ffd203;
            border: none;
        }

        .tips {
            height: 1.06rem;
            color: #616161;
            font-size: 0.24rem;
            line-height: 0.4rem;
            padding: 0 0.26rem;
            margin-top: 0.5rem;
            margin-bottom: 0.3rem;
        }

        .sure {
            outline: none;
            border: none;
            width: 6.9rem;
            height: 0.88rem;
            background-size: cover;
            line-height: 0.88rem;
            text-align: center;
            color: #181818;
            font-size: 0.32rem;
            background-color: #e5e5e5;
            margin: auto;
            -webkit-user-select: none;
            user-select: none;
            margin-left: calc((100% - 6.9rem) / 2);
        }

        #wrap span {
            display: none;
        }

        #wrap span {
            margin-left: 0.24rem;
        }

        input[type="radio"]+label::before {
            content: "\a0";
            display: inline-block;
            vertical-align: middle;
            width: 0.4rem;
            height: 0.4rem;
            margin-right: .1rem;
            border-radius: 50%;
            border: 1px solid #DBDBDB;
        }

        input[type="radio"]:checked+label::before {
            width: 0.2rem;
            height: 0.2rem;
            background-color: #ffd203;
            background-clip: content-box;
            padding: .1rem;
            border: 1px solid #ffd203;
        }

        input[type="radio"] {
            position: absolute;
            clip: rect(0, 0, 0, 0);
        }

        .shouRang {
            width: 100%;
            height: 1.04rem;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            -webkit-justify-content: space-between;
            align-items: center;
            -webkit-align-items: center;
        }

        .showN {
            display: inline-block;
            width: 0.4rem;
            height: auto;
            text-align: center;
        }

        .showNa {
            display: inline-block;
            width: 1rem;
            height: auto;
            text-align: center;
        }

        .cover-full {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 100;
            background-color: rgba(0, 0, 0, 0.6);
            width: 100%;
            height: 100%;
        }

        .enntueList {
            position: relative;
            top: 40%;
            left: 20%;
            background-color: #fff;
            width: 4.53rem;
            height: auto;
            border-radius: 0.1rem;
            padding-top: 0.66rem;
            font-size: 0.24rem;
            text-align: center;
            line-height: 0.4rem;
        }

        .enntueList span {
            font-weight: 500;
        }

        .button {
            margin-top: 0.56rem;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            -webkit-justify-content: space-between;
        }

        .button p {
            width: 50%;
            height: 0.9rem;
            line-height: 0.9rem;
        }

        .back {
            background-color: #f1f1f1;
            border-radius: 0 0 0 0.1rem;
        }

        .ensurEnstru {
            background-color: #ffd203;
            border-radius: 0 0 0.1rem 0;
        }

        #showtext {
            position: absolute;
            top: -0.2rem;
            right: -0.72rem;
            width: 0.72rem;
            height: 0.36rem;
            background: linear-gradient(180deg, rgba(255, 206, 72, 1) 0%, rgba(255, 158, 30, 1) 100%);
            opacity: 1;
            border-radius: 0.26rem 0.26rem 0.26rem 0px;
            font-size: 0.24rem;
            font-family: PingFang SC;
            font-weight: 500;
            color: rgba(255, 255, 255, 1);
            text-align: center;
        }

        .showChoose {
            width: 6.9rem;
            height: auto;
            background-color: #F8F8F8;
            padding: 0 0.25rem;
            box-sizing: border-box;
            border-radius: 0.1rem;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: flex-start;
            margin-top: 0.23rem;
            padding-bottom: 0.1rem;
        }

        .showChoose b {
            font-size: 0.28rem;
            font-family: PingFang SC;
            font-weight: bold;
        }

        .showChoose p {
            width: 100%;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.26rem 0 .2rem 0;
            color: #A1A1A1;
            font-size: 0.28rem;
        }

        .showChoose p a {
            color: #FFB303;
            font-size: 0.22rem;
            font-family: PingFang SC;
            font-weight: 500;
            text-decoration: underline;
        }

        .showChoose label {
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .showChoose label span {
            font-size: 0.28rem;
            font-family: PingFang SC;
            font-weight: 500;
        }

        .bhpayUserName {
            width: 100%;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            margin-top: 0.26rem;
        }

        .bhpayUserName input {
            display: inline-block;
            width: 100%;
            height: 0.82rem;
            font-size: 0.28rem;
        }

        .bhpayUserName span {
            padding-bottom: 0.02rem;
            border-bottom: 1px solid #e2e2e2;
        }

        .tipsText {
            height: 1rem;
            padding-left: 0.1rem;
            display: flex;
            display: -webkit-flex;
            justify-content: space-between;
            box-sizing: border-box;
            align-items: center;
        }

        .tipsText>p {
            flex: 1;
            font-size: 0.24rem;
            color: #EE3939;
            display: flex;
            display: -webkit-flex;
            align-items: center;
        }

        .tipsText a {
            font-size: 0.24rem;
            font-family: PingFang SC;
            font-weight: 500;
            color: #ffb203;
            text-decoration: underline;
        }

        input[type="text"],
        input[type="passowrd"] {
            padding-left: 0.1rem;
        }

        .chooseCoinAdress {
            display: flex;
            display: -webkit-flex;
            align-items: center;
            color: #262626;
            font-size: 0.24rem;
        }
    </style>
</head>

<body>
    <div class="typeCoinImg">
        <span class="coinName"></span>
        <span class="showmoney">
            <span
                style="display:flex;display:-webkit-flex;align-items: center;-webkit-align-items: center;font-size: 0.26rem;">
                可用: <span id="coinNum" style="font-size:0.28rem;">0.00000000</span>
            </span>
            <span class="changeR">
                ≈
                <span id="coinNumToal" style="font-size:0.24rem;color:rgba(18, 18, 18,0.68)">0.00</span>
            </span>
        </span>
    </div>
    <div class="coin-type" style="padding-bottom: 0.8rem;">
        <div class="showChoose">
            <b style="margin-top: 0.26rem;">请选择提币方式</b>
            <p style="border-bottom: 1px solid #E2E2E2;">
                <input type="radio" value="checkBhpay" name="chooseOutcoin" id="checkBhpay" checked>
                <label for="checkBhpay" style="position: relative;">
                    转入我的BHPay钱包
                    <span id="showtext">
                        推荐
                    </span>
                </label>
            </p>
            <p class="showOtnerpay">
                <input type="radio" value="checkOtherpay" name="chooseOutcoin" id="checkOtherpay">
                <label for="checkOtherpay">
                    转入其他数字钱包
                </label>
            </p>
        </div>
        <div class="showBhpayAcc" style="display: none;">
            <p class="userAccount">
            </p>
            <p class="bhpayAccNumber">
            </p>
            <a class="goAddpage">下载BHPay钱包<img src="../../image/doublejiantou.png"
                    style="width: 0.21rem;height: 0.15rem;margin-left: 0.1rem;"></a>
        </div>
        <div class="showNoBhpay" style="display: none;margin-top: 0.3rem;">
            <p
                style="width: 6.9rem;height: auto;display: flex;display: -webkit-flex;align-items: center;justify-content: center;padding: 1.6rem 0 1rem 0;margin-left: calc((100% - 6.9rem) / 2);">
                <img src="../../image/nocointest.png" style="width: 4.13rem;height: 2.52rem;">
            </p>
            <button id="openBhpayAcc">
                开通/关联BHPay账户
            </button>
        </div>
        <div class="showinputClass" style="padding-bottom: 0.8rem;display: none;">
            <ul>
                <li class="hideBhpay" style="display: none;">
                    <input class="checkTest" type="text" name="" id="otherAdress" placeholder="请输入您的收币地址" />
                    <span class="chooseCoinAdress">
                        <img src="../../image/dizhi.png" style="width:0.23rem;margin-right: 0.06rem;">常用地址
                    </span>
                </li>
                <li>
                    <div class="outnum" style="border-bottom:1px solid #e5e5e5;">
                        <input class="checkTest" type="text" oninput="this.value=this.value.replace(/[^\d\.]/g, '')"
                            name="" id="addnum" placeholder="请输入数量" />
                    </div>
                    <div class="shouRang">
                        <span class="showN"> 0 </span>
                        <span class="rangeBackground" style="display: block;">
                            <input class="rangeInput" type="range" id="inputRang" value="0" defaultValue="0"
                                min="0.0000" step="0.00000001" />
                            <span style="height: 5px;"></span>
                        </span>
                        <span class="showNa"> 100% </span>
                    </div>
                </li>
                <li class="setBcnypass" style="display:none;">
                    <div class="go-page"
                        data-param='{"page":"common/headerwin","name":"deal_password_headerwin","param":{"subpage":"mine/deal_password","name":"deal_password","title":"设置交易密码"}}'
                        style="width:100%;display:flex;display:-webkit-flex;justify-content: space-between;align-items: center;box-sizing: border-box;">
                        <span style="color: #ff9c9c;">
                            未设置交易密码
                        </span>
                        <span style="display: flex;display:-webkit-flex;align-items: center;">
                            <span style="color: #d9d9d9;margin-right:0.1rem;">
                                去设置
                            </span>
                            <img src="../../image/rightjt.png" style="height: 0.18rem;width:0.1rem;">
                        </span>
                    </div>
                </li>
                <li id="addBcnyPwd" style="display: none;">
                    <input class="checkTest" type="password" id="setPassword" placeholder="请输入交易密码"
                        oninput="this.value=this.value.replace(/\D/g, '')" maxlength="6" />
                </li>
                <li style="border-bottom: 1px solid #e5e5e5;border-top:1xp solid #e5e5e5;">
                    <div class="seft-num">
                        <input class="checkTest" type="text" oninput="this.value=this.value.replace(/\D/g, '')"
                            id="code" maxlength="6" placeholder="请输入验证码" />
                        <button class="saft-code" id="getSetmesseg"> 获取验证码 </span>
                    </div>
                </li>
                <li id="forgetBcnyPass" style="border:none;height: 0.88rem;padding-top: 0.2rem;display: none;">
                    <div class="forgetBcnyPass"
                        style="width: 100%;text-align: right;box-sizing: border-box;color: #ffd203;margin:0.3rem 0 0.3rem 0;">
                        忘记交易密码 申请找回
                    </div>
                </li>
                <li class="hideServiceCharge"
                    style="display: flex;display:-webkit-flex;align-items:center;display: none;">
                    手续费&nbsp;<span class="commission" style="padding-top: 0.06rem;">0.0015BTC</span>
                </li>
            </ul>
            <button class="sure" disabled>发起提币</button>
            <div class="tips">
                <span>提示: </span>
                <br>
                <span class="minOutcion">

                </span>
                <br>
                2.提币到BHPay钱包不收取手续费
                <br>
                3.请务必保证提币账号的准确性，否则资产将无法找回
                <br>
                <span class="showchange">
                    4.通过审核后0-60分钟到账，网络原因可能有延迟
                </span>
                <br>
                5.如长时间未到账，请联系客服核查
            </div>
        </div>
    </div>
    <script src="../../script/autosize.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/jquery_three_two_one.js"></script>
    <script src="../../script/app.js"></script>
    <script>
        apiready = function () {
            var app = new APP();
            var account = app.getAccount();
            var limAbout = api.pageParam.limAbout;//获取限制提币想关
            var coinType = api.pageParam.coinType;//币种名称
            var coinName = api.pageParam.coinName;//币种名称大写
            app.handlePage();
            var reg = /^[0-9]+.?[0-9]*$/;
            var regTwo = /([0-9]+\.[0-9]{2})[0-9]*/;
            var regFour = /([0-9]+\.[0-9]{4})[0-9]*/;
            var regEight = /([0-9]+\.[0-9]{8})[0-9]*/;
            var getUserPwd = 0, getCnySms, isCnyCaptcha = 0, susernameStatu = 0, tipsErr = "";
            var bhpUserName = "", bhpuserAccount = "", downBhpayUrl = "";//BHPay用户名 账号
            $(".minOutcion").text("1.最小提币数量为" + limAbout.bhpay + (coinName == "BHP_FH" ? "BHP" : coinName));
            $(".commission").text(limAbout.other.withdrawCoinFee + (coinName == "BHP_FH" ? "BHP" : coinName));//手续费
            //是否设置交易密码
            function getSetPass() {
                app.isPwd(function (ret) {
                    if (ret.code == 200) {
                        getUserPwd = 1;
                        $("#addBcnyPwd,#forgetBcnyPass").show();
                        $(".setBcnypass").hide();
                    } else {
                        $("#addBcnyPwd,#forgetBcnyPass").hide();
                        $(".setBcnypass").show().css("display", "flex");
                    }
                });
            }
            getSetPass();
            //获取BHPay关联信息
            function getBhpayAbout(params) {
                app.getBhpayAbout(function (ret) {
                    if (ret.code == 200) {
                        bhpUserName = ret.data.name;
                        bhpuserAccount = ret.data.card_num;
                        $(".userAccount").text(ret.data.name);
                        $(".bhpayAccNumber").text(ret.data.card_num.slice(0, 4) + " **** **** " + ret.data.card_num.slice(-4));
                        $(".showinputClass,.showBhpayAcc").show();
                        $(".showNoBhpay").hide();
                    } else {
                        $(".showinputClass,.showBhpayAcc").hide();
                        $(".showNoBhpay").show();
                    }
                })
            };
            getBhpayAbout();
            if (app.ST == "ios") {
                $("#coinNum").css("paddingTop", 0);
                $("input").click(function () {
                    $(this).focus().select(); //保险起见，还是加上这句。
                });
            }
            if (coinName == "BHP") {
                $(".coinName").text(coinName + "(交易账户)");
            } else if (coinName == "BHP_FH") {
                $(".coinName").text("BHP(分红账户)");
                $(".showOtnerpay").hide();
                $(".showChoose").css({
                    'paddingBottom': "0.4rem"
                })
            } else {
                $(".coinName").text(coinName);
            }
            //获取币种数量
            function coinNum(array, name) {
                for (var i = 0; i < array.length; i++) {
                    if (array[i].coin_name == name) {
                        return {
                            coin: array[i].coin,
                            totalPrice: array[i].coin_price
                        }
                    }
                }
            }
            function getNum() {
                app.getProperties(account, function (ret, err) {
                    var dataList = ret.data.lists.my_finance;
                    if (ret.code == 200) {
                        downBhpayUrl = ret.data.bhpay_uri;
                        var thisCoin = coinNum(dataList, coinType);
                        if (coinType == "btc" || coinType == "ltc" || coinType == "eth") {
                            thisCoin.coin = app.sliceNum(thisCoin.coin, 8);
                            $("#inputRang").attr("step", 0.00000001);
                        } else {
                            thisCoin.coin = app.sliceNum(thisCoin.coin, 4);
                            $("#inputRang").attr("step", 0.0001);
                        }
                        $("#coinNum").text(moneySlice(thisCoin.coin));
                        $("#coinNumToal").text(
                            app.outputmoney(thisCoin.totalPrice)
                        );
                        $("#inputRang").attr("value", 0);//初始化input
                        var coinTypeNum = Number(thisCoin.coin);//币种数量
                        $("#inputRang").attr("max", coinTypeNum);
                        $("#inputRang").on("input propertychange", function () {
                            var maxInput = Number($(this).attr("max"));
                            var thisNum = Number($(this).val()).toFixed(9);
                            var thisValue = app.sliceNum(thisNum, 8);
                            if (coinType == "bhp" || coinType == "usdt" || coinType == "bhpfh") {
                                thisValue = app.sliceNum(thisNum, 4);
                            }
                            var backgorundSize = app.accMul(app.accDiv(thisValue, maxInput), 100);
                            $(this).css("background-size", backgorundSize + "% 100%");
                            $("#addnum").val(thisValue);
                            checkIsblank();
                        });
                    }
                })
            }
            getNum();

            function getCodeCallback() {
                // 执行倒计时
                app.countDown(60, function (value) {
                    if (value.time != 0) {
                        $("#getSetmesseg").text(value.time + "s");
                    } else {
                        _fmOpt.reset();
                        $("#getSetmesseg").text("获取验证码").attr("disabled", false).bind("click");
                    }
                });
                app.getSmslogin({
                    blackBox: isCnyCaptcha == 1 ? _fmOpt.getinfo() : "",
                    yzm_token: getCnySms
                }, function (ret) {
                    if (ret.code == 200) {
                        app.toast("发送成功");
                    } else {
                        app.toast(ret.message);
                    }
                })
            }
            //CNY 同盾插件初始化
            _fmOpt = {
                display: 'bind', //popup方式渲染验证码
                container: '#getSetmesseg', //验证码button渲染的目标DOM，自动展现方式下必需，详情见后文
                area: '', //对于custom模式，弹出窗口的加载容器，详情见后文
                partner: "renrenkj",
                appName: "renrenkj_h5",
                width: "",
                height: "",
                fmb: true,
                initialTime: new Date().getTime(),
                token: "renrenkj" + "-" + new Date().getTime() + "-" + Math.random().toString(16).substr(2),
                env: 1,
                getinfo: function () {
                    return "e3Y6ICIyLjUuMCIsIG9zOiAid2ViIiwgczogMTk5LCBlOiAianMgbm90IGRvd25sb2FkIn0=";
                }
            };
            var fm = document.createElement('script');
            fm.type = 'text/javascript';
            fm.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'static.tongdun.net/captcha/main/tdc.js?ver=1.0&t=' + (new Date().getTime() / 600000).toFixed(0);
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(fm, s);
            _fmOpt.beforeValidate = function () {
                $("#getSetmesseg").attr("disabled", true).unbind("click");
                app.checkIsMechine("sms", function (ret, err) {
                    if (ret.code == 200) {
                        isCnyCaptcha = ret.data;
                        if (isCnyCaptcha == 1) {
                            _fmOpt.onSuccess = function (validateToken) {
                                if (validateToken) {
                                    getCnySms = validateToken;
                                    getCodeCallback();
                                } else {
                                    _fmOpt.reset();
                                }
                            };
                            return true;
                        } else {
                            getCodeCallback();
                            return false
                        }
                    }
                })
                return true
            }
            _fmOpt.onClose = function (params) {
                $("#getSetmesseg").text("获取验证码").attr("disabled", false).bind("click");
            }
            $("#addnum").on("input porpertychange", function () {
                var thisVAL = $(this).val();
                var maxNumber = Number($("#coinNum").text());
                if ($(this).val() == "") {
                    $("#inputRang").val(0).css("background-size", "0% 100%");
                    return
                }
                var re = /^[0-9]+.?[0-9]*$/;
                if (!re.test(thisVAL)) {
                    app.toast("请输入正确的数字");
                    $(this).val("");
                    return false;

                }
                if (Number(thisVAL) > maxNumber) {
                    var thisnumInput = app.sliceNum(Number(maxNumber).toFixed(9), 8);
                    if (coinType == "bhp" || coinType == "usdt" || coinType == "bhpfh") {
                        thisnumInput = app.sliceNum(Number(maxNumber).toFixed(5), 4);
                    }
                    $(this).val(thisnumInput);
                    var rangeSteps = app.sliceNum(maxNumber, 8);
                    var thisMax = Number($("input[type=range]").attr("max"));
                    var backgroundSize = (rangeSteps / thisMax) * 100;
                    $("input[type=range]").val($(this).val()).css("background-size", backgroundSize + "% 100%");
                    return
                }
                var textNumber = app.sliceNum($("#addnum").val(), 8);
                if (coinType == "bhp" || coinType == "usdt" || coinType == "bhpfh") {
                    textNumber = app.sliceNum($("#addnum").val(), 4);
                }
                $("#addnum").val(textNumber);
                var thisMax = Number($("input[type=range]").attr("max"));
                var backgroundSize = (textNumber / thisMax) * 100;
                $("input[type=range]").val($(this).val()).css("background-size", backgroundSize + "% 100%");
            });
            $(".chooseCoinAdress").click(function () {
                var pageValue = {
                    name: "choose_address",
                    subpage: "salescommission/choose_address",
                    title: "选择提币地址",
                    param: {
                        pageName: "choose_address",
                        allowEdit: true,
                        coinName: coinName

                    },
                }
                app.setNavBarAttr(pageValue);
            })
            function moneySlice(nb) {
                var newMoneyArr = String(nb).replace(regEight, "$1");
                return newMoneyArr;
            }
            // 监听点击对话框确认按钮
            app.listen("ok", function () {
                app.tout(200, function () {
                    api.closeWin();
                });
            });

            function checkIsblank() {
                var codeNumber = $("#code").val().trim();
                var outAddress = $("#otherAdress").val().trim();
                var outNUmber = $("#addnum").val().trim();
                var setPassword = $("#setPassword").val().trim();
                var checkChoose = $("input[name='chooseOutcoin']:checked").val();
                if (checkChoose == "checkBhpay" && getUserPwd != 0 && codeNumber && outNUmber && setPassword) {
                    $(".sure").css({
                        backgroundColor: "#ffd203"
                    }).attr("disabled", false);
                } else if (checkChoose == "checkOtherpay" && getUserPwd != 0 && codeNumber && outAddress && outNUmber && setPassword) {
                    $(".sure").css({
                        backgroundColor: "#ffd203"
                    }).attr("disabled", false);
                } else if (checkChoose == "checkBhpay" && getUserPwd == 0 && codeNumber && outNUmber) {
                    $(".sure").css({
                        backgroundColor: "#ffd203"
                    }).attr("disabled", false);
                } else if (checkChoose == "checkOtherpay" && getUserPwd == 0 && codeNumber && outAddress && outNUmber) {
                    $(".sure").css({
                        backgroundColor: "#ffd203"
                    }).attr("disabled", false);
                } else {
                    $(".sure").css({
                        backgroundColor: "#e5e5e5"
                    }).attr("disabled", true);
                }
            }
            $(".showChoose input[type=radio][name=chooseOutcoin]").on("change", function () {
                var thisRadio = $(this).val();
                $(".showinputClass").hide();
                if (thisRadio == "checkBhpay") {
                    getBhpayAbout();
                    $(".hideBhpay,.hideServiceCharge").hide();
                    $(".tipsText span").text("");
                    $(".tipsText,.bhpayUserName").show();
                    $(".bhpayUserName input").val("");
                    $(".showchange").text("4.通过审核后0-60分钟到账，网络原因可能有延迟");
                    $(".minOutcion").text("1.最小提币数量为" + limAbout.bhpay + (coinName == "BHP_FH" ? "BHP" : coinName));
                } else {
                    $(".minOutcion").text("1.最小提币数量为" + limAbout.other.repurchaseMin + (coinName == "BHP_FH" ? "BHP" : coinName));
                    $(".hideBhpay,.showinputClass,.hideServiceCharge").show();
                    $(".tipsText,.bhpayUserName,.showBhpayAcc,.showNoBhpay").hide();
                    $("#otherAdress").val("");
                    $(".showchange").text("4.通常情况下提币审核会在24小时内完成，通过审核后60分钟内到账(网络情况不佳可能有延迟)");
                }
                checkIsblank();
            })
            $(".checkTest").on("input porpertychange", function () {
                checkIsblank();
            });
            $(".forgetBcnyPass").on("click", function () {
                if (getUserPwd == 2) {
                    app.toast("审核中");
                    return
                }
                var cointypecontract = {
                    page: "common/headerwin",
                    name: "forget_password_headerwin",
                    param: {
                        subpage: "mine/forget_password",
                        name: "get_cash",
                        title: "忘记交易密码"
                    }
                };
                var recoinNumber = JSON.stringify(cointypecontract);
                app.goPushPage(recoinNumber);
            })
            $(".sure").on("click", function () {
                if (getUserPwd == 0) {
                    app.toast("请先设置交易密码");
                    return
                }
                var param = {
                    dtype: "dialog25"
                };
                app.dialog(param);
            });

            // 处理点击提交
            app.listen("needOutCoin", function () {
                if ($("input[name='chooseOutcoin']:checked").val() == "checkBhpay") {
                    app.ajaxPro({
                        url: "bhpay/winth-coin",
                        values: {
                            token: account.token,
                            currency_name: coinName,
                            num: $("#addnum").val().trim(),
                            smscaptcha: $("#code").val(),
                            trade_password: $("#setPassword").val().trim()
                        },
                        openFlower: true
                    }, function (ret) {
                        if (ret.code == 200) {
                            app.trigger("get_coin_success");
                            var param = {
                                dtype: "dialog2",
                                data: {
                                    title: "提示",
                                    text: ret.message,
                                    btns: [{
                                        name: "确认",
                                        event: "ok",
                                        style: "color:#0095E5;"
                                    }]
                                }
                            };
                            app.dialog(param);
                        } else {
                            app.toast(ret.message);
                        }
                    })
                } else {
                    var param = {
                        dtype: "dialog93"
                    };
                    app.dialog(param);
                }
            });
            app.listen("sureOutcoin", function () {
                app.ajaxPro({
                    url: "finance/coin-withdraw",
                    values: {
                        token: account.token,
                        wallet_address: $("#otherAdress").val(),
                        coin_type: coinName,
                        coin_num: $("#addnum").val().trim(),
                        smscaptcha: $("#code").val(),
                        trade_password: $("#setPassword").val().trim()
                    },
                    openFlower: true
                }, function (ret) {
                    if (ret.code == 200) {
                        app.trigger("get_coin_success");
                        var param = {
                            dtype: "dialog2",
                            data: {
                                title: "提示",
                                text: "发起提币成功！",
                                btns: [{
                                    name: "确认",
                                    event: "ok",
                                    style: "color:#0095E5;"
                                }]
                            }
                        };
                        app.dialog(param);
                        return
                    } else {
                        app.toast(ret.message);
                    }
                })
            })
            var event = ["get_coin_success", "setdealPassOk"];
            app.listen(event, function () {
                app.reload();
            });
            $("#openBhpayAcc").click(function () {
                var param = {
                    dtype: "dialog41"
                };
                app.dialog(param);
                app.getBhpayURL(account, function (ret) {
                    if (ret.code == 200) {
                        setTimeout(function () {
                            app.closeDialog();
                            app.openWin({
                                name: "browser_headerwin",
                                url: app.hd + "common/headerwin.html",
                                pageParam: {
                                    subpage: ret.data,
                                    name: "browser",
                                    type: "remote",
                                    isremote: "true",
                                    title: "BHPay",
                                    openBHpay: 'true'
                                }
                            });
                        }, 1000)
                    } else {
                        app.toast(ret.message)
                    }
                })
            });
            $(".goAddpage").click(function () {
                app.openSysNavi(downBhpayUrl);
            })
            api.addEventListener({
                name: 'appintent'
            }, function (ret, err) {
                if (ret) {
                    if (ret.appParam.urlScheme && ret.appParam.urlScheme == "openOutcoinPage" && ret.appParam.isAddAccountSucc == "no") {
                        app.closeW("browser_headerwin")
                        app.reload();
                    } else {
                        app.closeW("browser_headerwin")
                        app.reload();
                    }
                } else {
                    app.closeW("browser_headerwin")
                    app.reload();
                }
            });
            app.listen("reloadOutcoin", function () {
                app.reload();
            });
            app.listen("chooseAddress", function (ret) {
                $("#otherAdress").val(ret.value);
            })
            app.headerMap();
        };
    </script>
</body>

</html>